import request from '@/utils/request'

// 查询登录日志列表
export function list (query) {
  return request({
    url: '/pneumatic/subjectList',
    method: 'get',
    params: query
  })
}
export function delSubject (infoId) {
  return request({
    url: '/pneumatic/removeSubject/' + infoId,
    method: 'delete'
  })
}
export function addSubject (data) {
  return request({
    url: '/pneumatic/addSubject',
    method: 'post',
    data
  })
}
export function updateSubject (data) {
  return request({
    url: '/pneumatic/updateSubject',
    method: 'put',
    data
  })
}

export function getProjectList (query) {
  return request({
    url: '/pneumatic/projectList',
    method: 'get',
    params: query
  })
}
export function addProject (data) {
  return request({
    url: '/pneumatic/addProject',
    method: 'post',
    data
  })
}
export function updateProject (data) {
  return request({
    url: '/pneumatic/updateProject',
    method: 'put',
    data
  })
}
export function delProject (infoId) {
  return request({
    url: '/pneumatic/removeProject/' + infoId,
    method: 'delete'
  })
}
export function getFileList (query) {
  return request({
    url: '/pneumatic/fileList',
    method: 'get',
    params: query
  })
}
export function delFile (data) {
  return request({
    url: '/pneumatic/file/removeFile',
    method: 'delete',
    data
  })
}
export function getFileDataList (query) {
  return request({
    url: '/pneumatic/getFileData',
    method: 'get',
    params: query
  })
}
export function downloadFile (query) {
  return request({
    url: '/pneumatic/file/download',
    method: 'post',
    data: query
  })
}
export function getFileResultDataList (query) {
  return request({
    url: '/pneumatic/getFileResultData',
    method: 'get',
    params: query
  })
}
export function globalSearch (query, pageParams) {
  return request({
    url: '/pneumatic/globalSearch?pageNum=' + pageParams.pageNum + '&pageSize=' + pageParams.pageSize + '&fileType=' + pageParams.fileType,
    method: 'post',
    data: query
  })
}
export function fileListUpload (query, timeStamp) {
  return request({
    url: '/pneumatic/file/upload?timeStamp=' + timeStamp,
    method: 'post',
    data: query
  })
}
// updateUserSubject
export function updateUserSubject (query) {
  return request({
    url: '/pneumatic/updateUserSubject',
    method: 'post',
    data: query
  })
}
export function getAuthList (query) {
  return request({
    url: '/pneumatic/authSubjectList',
    method: 'get',
    params: query
  })
}
